//
// main.c
// Intersections
//
// Created by Ian Beardsley on 1/7/25.
//
#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[]) {
float R_p, M_p, R_s, M_s, L_s, h_s, t_c, M_m, rho_m, rho_p, PlanetDay,
V_p,StarRadius, PlanetRadius, PlanetMass, StarLuminosity, PlanetOrbit,
StarMass, r_p, T_p, p, L_p, KE_p, v_p, Root;
float G=6.674E-11, hbarstar, PDCT;
float Mcubed, r_m, root, civilization, R_m, V_m, MoonDensity, part1,
part2, part3,v_m, KE_m;
int i;
printf ("What is the radius of the star in solar radii? ");
scanf ("%f", &StarRadius);
printf ("What is the mass of the star in solar masses? ");
scanf ("%f", &StarMass);
printf ("What is the luminosity of the star in solar luminosities? ");
scanf ("%f", &StarLuminosity);
PlanetOrbit=sqrt(StarLuminosity);
r_p=PlanetOrbit*1.496E11;
printf ("What is the radius of the planet in Earth radii? May we suggest
it is given by 2StarRadius^2/PlanetOrbitalRadius? 1=yes, 0=no ");
scanf ("%i", &i);
R_p=0;
if (i==1)
{
R_s=6.9634E8*StarRadius;
R_p=(2*R_s*R_s)/r_p;
printf ("The radius of the planet is: %fE6m\n", R_p/1E6);
printf ("that is %f Earth Radii \n", R_p/6.378E6);
}
else
{
printf("What is the planet radius in Earth radii?: ");
scanf("%f", &PlanetRadius);
R_p=PlanetRadius*6.378E6;
}
printf("What is the mass of the planet in Earth masses? May we
suggest that it is such that it has the density of the Earth? 1=yes, 0=no ");
scanf("%i", &i);
if (i==1)
{
V_p=1.33333*(3.14159)*R_p*R_p*R_p;
M_p=V_p*5510;
PlanetMass=M_p/5.972E24;